package com.sziit.se.highconcurrency.order.application.service.impl;

import com.sziit.se.highconcurrency.order.application.entity.Order;
import com.sziit.se.highconcurrency.order.application.mapper.OrderMapper;
import com.sziit.se.highconcurrency.order.application.service.IOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author dongchunkeng
 * @since 2022-11-09
 */
@Service
@AllArgsConstructor
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements IOrderService {

    private final OrderMapper orderMapper;
    @Override
    public List<Order> getAllData() {
        return orderMapper.getAllData();
    }

    @Override
    public Boolean insertOrder(String orderId, String userId, String status) {
        return orderMapper.insertOrder(orderId, userId, status);
    }

    @Override
    public Order getOneData(String orderId) {
        return orderMapper.getOneData(orderId);
    }

    @Override
    public List<Order> getOrdersByPage(String userId) {
        return orderMapper.getOrdersByUserId(userId);
    }


}
